Passed
Push — master ( add66c...3bf222 )
by Christofer
01:09
created

Rook.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 9.4285
1
/**
2
 * Rook module
3
 * @module
4
 */
5
"use strict";
6
7
/**
8
 * Class with Rook logic
9
 */
10
class Rook {
11
    /**
12
     * init
13
     */
14
    constructor(color) {
15
        this.symbol = "R";
16
        this.moved = 0;
17
        this.active = true;
18
        this.color = color;
19
    }
20
21
    legalMove(x, y, nx, ny) {
22 6
        if (x == nx && y !== ny || x !== nx && y == ny) {
23
            return true
24
        }
25
26
        return false;
27
    }
28
}
29
30
31
module.exports = Rook;
32